Ubuntu永久修改IP、临时修改IP |
您所在的位置:网站首页 › ubuntu18 配置ip › Ubuntu永久修改IP、临时修改IP |
永久修改静态IP、DHCP自动获取IP 1. 修改 /etc/network/interfaces 配置文件: $ sudo vi /etc/network/interfaces 静态配置IP方式: #静态ip设置方式 auto lo iface lo inet loopback #ens33为网卡名,ifconfig可查看网卡名 auto ens33 iface ens33 inet static address 192.168.11.111 netmask 255.255.255.0 gateway 192.168.11.1 #设置dns服务器 dns-nameservers 119.29.29.29DHCP方式: #dhcp方式获取ip配置 auto lo iface lo inet loopback #ens33为网卡名,ifconfig可查看网卡名 auto ens33 iface ens33 inet dhcp2. 重启网卡,使之配置生效 $ sudo /etc/init.d/networking restart 或者 $ ifdown eth0 //关闭网卡 $ ifup eth0 //启动网卡 还不行的话重启Ubuntu,再次查看IP已经修改 临时修改IP: $ ifconfig erh0 192.168.1.28 255.255.255.0 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |